import * as api from './api'

export default {
  // 获取分页列表
  getBoundsList: (current, size, params) => {
    return api.get(`/manage/integral-product/${current}/${size}`, params)
  },
  // 获取分页列表
  getBoundsWithdrawList: (current, size, params) => {
    return api.get(`/manage/user-integral-product/${current}/${size}`, params)
  },
  // 获取统计
  getTotal: () => {
    return api.get('/manage/integral-product/statistics')
  },
  // 修改热门
  modifyHot: (params) => {
    return api.put(`/manage/integral-product/hot/${params}`)
  },
  // 修改状态
  modifyState: (params) => {
    return api.put(`/manage/integral-product/state/${params}`)
  },
  // 创建|编辑礼物
  createModify: (params) => {
    const url = '/manage/integral-product'
    const headers = {}
    if (params && params.id) {
      headers['lang-key'] = 'edit'
      return api.put(url, params, headers)
    } else {
      headers['lang-key'] = 'found'
      return api.post(url, params, headers)
    }
  },
  // 审核
  audit: (params) => {
    return api.put('/manage/user-integral-product/audit', params)
  },
}
